﻿#pragma once

#include "core/Macro.h"
#include "function/RenderSystem/AbstractShader.h"

namespace Engine
{
	class ENGINE_API ShaderLibrary
	{
	public:
		void Add(const std::string& name, const Ref<AbstractShader>& shader);
		void Add(const Ref<AbstractShader>& shader);
		Ref<AbstractShader> Load(const std::string& filepath);
		Ref<AbstractShader> Load(const std::string& name, const std::string& filepath);

		Ref<AbstractShader> Get(const std::string& name);

		[[nodiscard]] bool Exists(const std::string& name) const;

	private:
		std::unordered_map<std::string, Ref<AbstractShader>> shaders;
	};
}
